package model

import (
	"gorm.io/gorm"
	"time"
)

type Student struct {
	Id           uint64         `gorm:"column:id;type:int UNSIGNED;primaryKey;not null;" json:"id"`
	Mobile       string         `gorm:"column:mobile;type:char(32);not null;" json:"mobile"`
	Password     string         `gorm:"column:password;type:char(32);not null;" json:"password"`
	StudentName  string         `gorm:"column:student_name;type:varchar(30);comment:学员名称;not null;" json:"student_name"`   // 学员名称
	StudentCard  string         `gorm:"column:student_card;type:varchar(50);comment:学员学号;not null;" json:"student_card"`   // 学员学号
	StudentClass string         `gorm:"column:student_class;type:varchar(30);comment:学员班级;not null;" json:"student_class"` // 学员班级
	College      string         `gorm:"column:college;type:varchar(30);comment:学院;not null;" json:"college"`               // 学院
	CreatedAt    time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt    time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (s *Student) TableName() string {
	return "student"
}
